<extend name="Public:admin"/>
<block name="extra-js">
<script src="__JS__/plugins/metisMenu.min.js"></script>
<script src="__JS__/plugins/jquery.dataTables.js"></script>
<script src="__JS__/plugins/dataTables.bootstrap.js"></script>
<script>
    $(function () {
        $(':checkbox[name="group[]"]').click(function () {
            $(':checkbox', $(this).closest('li')).prop('checked', this.checked);
        });

        $('#backid').click(function(){
                window.location.href="index.html";
         });
    });
</script>
</block>
<block name="main-content">
<div class="col-lg-12">
      <h1 class="page-header">编辑用户</h1>
</div>
<form action="__URL__/editUser?id={$user_id}" method="post" class="definewidth m20">
    <table class="table table-bordered table-hover definewidth m10">
        <tbody>
        <tr>
            <td width="10%" class="tableleft">用户名称</td>
            <td><input type="text" name="username" value="{$username}"></td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">旧密码</td>
            <td><input type="password" name="oldpassword"></td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">新密码</td>
            <td><input type="password" name="newpassword"></td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">用户类型</td><td>
            <select id="user-type" name="usertype" class="form-control input_width">
            <option value="ADMIN" <if condition="$usertype eq 0">selected="selected"</if> >管理员</option>
                    <option value="STORE" <if condition="$usertype eq 1">selected="selected"</if> >商家</option>
                    <option value="USER" <if condition="$usertype eq 2">selected="selected"</if> >用户</option>
            </select></td>
        </tr>
        <tr>
            <td class="tableleft">状态</td>
            <td>
                <input type="radio" name="status" value="1" checked=""> 启用  <input type="radio" name="status" value="0"> 禁用
            </td>
        </tr>
        <if condition="$usertype eq 1">
        <tr>
            <td class="tableleft">权限</td>
            <td>
                <ul>
                  <li>
                    <label class="checkbox inline">
                      <h4>模块编辑</h4>
                    </label>
                      <ul>
                      <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="Place" <if condition="$uspmt['Place_PERMIT'] eq TRUE">checked</if> >全局编辑</label></li>
                      <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="Info" <if condition="$uspmt['Info_PERMIT'] eq TRUE">checked</if> >景点信息</label></li>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="Hotel" <if condition="$uspmt['Hotel_PERMIT'] eq TRUE">checked</if> >住宿信息</label></li>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="Resturant" <if condition="$uspmt['Resturant_PERMIT'] eq TRUE">checked</if> >餐饮信息</label></li>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="Photos" <if condition="$uspmt['Photos_PERMIT'] eq TRUE">checked</if> >相册信息</label></li>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="Theme" <if condition="$uspmt['Theme_PERMIT'] eq TRUE">checked</if> >主题编辑</label></li>
                      </ul>
                  </li>
                </ul>
                <ul>
                  <li>
                    <label class="checkbox inline">
                      <h4>系统管理</h4>
                    </label>
                      <ul>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="User" <if condition="$uspmt['User_PERMIT'] eq TRUE">checked</if> >用户管理</label></li>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="LoginHistory" <if condition="$uspmt['LoginHistory_PERMIT'] eq TRUE">checked</if> >登录日志</label></li>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="BackUp" <if condition="$uspmt['BackUp_PERMIT'] eq TRUE">checked</if> >备份管理</label></li>
                      </ul>
                  </li>
                </ul>
                <ul>
                  <li>
                    <label class="checkbox inline">
                      <h4>报表管理</h4>
                    </label>
                      <ul>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="ChartAnalyse" <if condition="$uspmt['ChartAnalyse_PERMIT'] eq TRUE">checked</if> >报表分析</label></li>
                      </ul>
                  </li>
                </ul>
                <ul>
                  <li>
                    <label class="checkbox inline">
                      <h4>资讯管理</h4>
                    </label>
                      <ul>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="News" <if condition="$uspmt['News_PERMIT'] eq TRUE">checked</if> >新闻管理</label></li>
                        <li><label class="checkbox inline"><input type="checkbox" name="permitssion[]" value="Comment" <if condition="$uspmt['Comment_PERMIT'] eq TRUE">checked</if> >评论管理</label></li>
                      </ul>
                  </li>
                </ul>
                <ul>
                  <li>
                    <label class="checkbox inline">
                      <input type="checkbox" name="group[]" value="Contact" <if condition="$uspmt['Contact_PERMIT'] eq TRUE">checked</if> >联系管理
                    </label>
                  </li>
                </ul>
            </td>
        </tr>
      </if>
        <tr>
            <td class="tableleft"></td>
            <td>
                <button type="submit" class="btn btn-primary">保存</button> &nbsp;&nbsp;<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
            </td>
        </tr>
    </tbody></table>
</form>
</block>